Skip to main content
Version: older

v3.4.2 to v3.5.0

WARNING POTENTIAL BUG

Due to a bug in TGenericRepositoryEF correct with package V3.5.1 you should remove the following line in your IocContainer.cs file

  collection.AddScoped(typeof(ITGenericRepository<,>), typeof(TGenericRepositoryEF<,>));

To force the usage of the last version package (ie V3.5.1 or higher) run in the Package Manager Console :

dotnet restore --no-cache

You should use BIA.Net.Core.Domain + BIA.Net.Core.Infrastructure.Data + BIA.Net.Core.Ioc V3.5.1 or higher.

AUTOMATIC MIGRATION

  1. Use the BIAToolKit to migrate the project

  2. Manage the conflict (2 solutions)

    1. In BIAToolKit click on "4 - merge Rejected" and search <<<<< in all files.
    • Resolve the conflict manually.
    1. Analyze the .rej file (search "diff a/" in VS code) that have been created in your project folder
    • Apply manually the change.
  3. Change source path and run the script V3.4.2_to_V3.5.0_Replacement.ps1

  4. Apply other manual step (describe bellow) at the end if all is ok, you can remove the .rej files (during the process they can be useful to resolve build problem)

MANUAL STEPS

FRONT

  1. replace .culture$. by .currentCultureDateFormat$. in the biaTranslationService. ex:

    this.biaTranslationService.culture$

    by

    this.biaTranslationService.currentCultureDateFormat$
  2. replace import LazyLoadEvent from 'primeng' by 'primeng/api'. Other prime import have similar problems. ex:

    import { LazyLoadEvent } from 'primeng';

    by

    import { LazyLoadEvent } from 'primeng/api';

BACK

  1. search "ListComponent !== undefined" and correct OnDisplay function in CRUD : Remove the useless dispatch(loadAllByPost
      OnDisplay() {
    // if (this.memberListComponent !== undefined) {
    // this.store.dispatch(loadAllByPost({ event: this.memberListComponent.getLazyLoadMetadata() }));
    }

TROUBLESHOOTING

FRONT

This migration contains a major upgrade for Angular project. The angular version upgrade from v9 to v12. included PrimeNg from v9 to v12.

Breaking changes

  • With PrimeNg, the main difference is, v10 uses p-* prefix for classes whereas older versions use ui-*
  • Icon naming change: ui-icon-xxx is replaced by pi pi-xxx (where xxx is the icon name)
  • The icon filter-list is replaced by the icon filter.
  • The icon chevron-down is replaced by the icon angle-down.
  • Float label : All input text components support floating labels by adding (.p-float-label) to wrapper class. before
      <span class="md-inputfield">
<input formControlName="name" type="text" pInputText maxlength="64" />
<label><span class="bia-star-mandatory">*</span>{{ 'airport.name' | translate }}</label>
</span>

after

      <span class="p-float-label">
<input formControlName="name" type="text" pInputText maxlength="64" />
<label><span class="bia-star-mandatory">*</span>{{ 'airport.name' | translate }}</label>
</span>
  • PrimeNg traduction Now the traduction use the same json file. So there is a "primeng" element into the I18N json files.

Change done by the script V3.4.2_to_V3.5.0_Replacement.ps1:

Keep the same order listed bellow.

  • Replace in html and scss files all ui-icon- by pi pi-
  • Replace in html and scss files all chevron-down by angle-down.
  • Replace in html and scss files all filter-list by filter.
  • Replace in html and scss files all md-inputfield by p-float-label.
  • Replace in html and scss files all ui-button-secondary by p-button-outlined.
  • Replace in html and scss files all ui- prefix by p-. Only in files *.ts, *.html, *.scss.
  • Dropdown
    • You have to set the width of the dropdown according to your form :
      • either by parameter
        [style]="{ width: '100%' }" 
      • either by scss
        :host ::ng-deep .p-dropdown {
        width: 14rem;
        }

BACK

Automatic

Change done by the script V3.4.2_to_V3.5.0_Replacement.ps1:

  1. Search "Mapper()" in the solution and replace the new Mapper() init by call of InitMapper() (ex for Notification) var mapper = new NotificationMapper(); by NotificationMapper mapper = this.InitMapper<NotificationDto, NotificationMapper>();

  2. replace "FileFiltersDto" by "PagingFilterFormatDto" and resolve using if required

  3. replace "VersionedTable, IEntity" by "VersionedTable, IEntity<int>"

    • And after "VersionedTable, IEntity<int><int>" to "VersionedTable, IEntity<int>"
  4. replace ": BaseDto" by ": BaseDto<int>"

    • And after ": BaseDto<int><int>" to ": BaseDto<int>"
  5. search all : FilteredServiceBase< and add "int" as second template parameter

  • You can use replacement by using expression replace : FilteredServiceBase<(.*)> by : FilteredServiceBase<$1, int>
  1. search all ITGenericRepository< and add int as second template parameter
  • You can use replacement by using expression replace ITGenericRepository<(.*)> by ITGenericRepository<$1, int>
  1. search all : AppServiceBase< and add int as second template parameter
  • You can use replacement by using expression replace : AppServiceBase<(.*)> by : AppServiceBase<$1, int>
  1. search all : CrudAppServiceBase< and add int as third template parameter
  • You can use replacement by using expression replace : CrudAppServiceBase<(.\*),(.\*),(.\*),(.\*)> by : CrudAppServiceBase<$1,$2, int,$3,$4>
  1. search all : ICrudAppServiceBase< and add int as third template parameter
  • You can use replacement by using expression replace : ICrudAppServiceBase<(.\*),(.\*),(.\*)> by : ICrudAppServiceBase<$1,$2, int,$3>
  1. search all : BaseMapper< and add int as third template parameter
  • You can use replacement by using expression replace : BaseMapper<(.\*),(.\*)> by : BaseMapper<$1,$2, int>
  1. Not used IGenericRepository any more. Use ITGenericRepository

  2. Not used DataRepository any more. Use TGenericRepositoryEF

  3. Not used GenericRepositoryEF any more. Use TGenericRepositoryEF

BUILD

no change

DEPLOY

no change